<?php 

echo form_open('student/update');

echo form_hidden('id', $row[0]->id);

// an array of the fields in the student table
$field_array = array('nom','prenom','email','tel');
echo '<table border="1" BORDERCOLOR=#5EA600 style="margin-bottom:30px;" cellpadding="3" cellspacing="0">';
foreach($field_array as $field_name)
{
  echo '<tr><td  bgcolor="#66cc44">' . $field_name.'</td>';
  echo '<td  bgcolor="#dddddd">'.form_input($field_name, $row[0]->$field_name,'size=40px'). '</td></tr>';
}

echo '</table>';
// not setting the value attribute omits the submit from the $_POST array

echo form_submit('', 'Update','style="background-color:#66cc44;"'); 

echo form_close();

?>
